﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ERPEF.Model
{
    //销售退货主表
    public class sal_sales_Return
    {
        [Key]
        public int Return_Id { get; set; } //销售退货Id
        public string? Return_code { get; set; } //销售退货单号
        public string? so_code { get; set; } //销售单号
        public string client_head { get; set; } //客户姓名
        public string client_phone { get; set; } //联系方式
        public char so_out_status { get; set; } //销售订单/出库状态
        public string Return_status { get; set; } //订单状态 0：未完成 1：已完成
        public DateTime Return_date { get; set; } //退货日期
        public bool IsDeleted { get; set; } = false; // 逻辑删除字段
        public string? auditor { get; set; } //审核人
        public DateTime? auditTime { get; set; } //审核时间
        public bool AuditStatus { get; set; } //审核状态
        public string employee_name { get; set; } //操作人
        public string returmReason { get; set; } //退货原因

        public List<sal_sales_Return_C> sal_sales_Return_C { get; set; }
        public virtual string ToString()
        {
            if (sal_sales_Return_C != null && sal_sales_Return_C.Count > 0)
            {
                return sal_sales_Return_C.Count + " - " + sal_sales_Return_C[0].orders_product_name;
            }
            else
            {
                return base.ToString(); // 或返回其他默认值  
            }
        }
    }
}
